import ui
import card_manager
import data_manager

def main():
    # 初始化窗口
    window = ui.init_window()

    # 设置UI
    frames = ui.setup_ui(window)

    # 加载已有数据
    tasks_data = data_manager.load_data()
    for task in tasks_data:
        card_manager.create_card(frames["To_Do"], task['name'], task['priority'], task['due_date'], task['image_path'])

    # 运行主循环
    window.mainloop()

if __name__ == "__main__":
    main()